import numpy as np
import matplotlib.pyplot as plt
import cv2


class ProccessImg(object):

    def __init__(self, img, sigma):
        self.img = img
        self.sigma = sigma

    def sharpen_img(self):
        kernel = np.array([[1, 2, 1], [2, 4, 2], [1, 2, 1]], np.float32) / 16
        img_sharpen = cv2.filter2D(self.img, -1, kernel=kernel)
        # plt.imshow(img_sharpen.astype(np.uint8)[:, :, ::-1])
        # plt.show()
        cv2.imshow('a', img_sharpen.astype(np.uint8))
        cv2.waitKey(0)


if __name__ == '__main__':
    img = cv2.imread('../data/3024658/5.png')
    plt.imshow(img.astype(np.uint8)[:, :, ::-1])
    plt.show()
    A = ProccessImg(img, 3.0)
    A.sharpen_img()
